/*
 * @lc app=leetcode.cn id=1 lang=typescript
 *
 * [1] 两数之和
 */

// @lc code=start
function twoSum(nums: number[], target: number): number[] {
    let i = 0;
    let found = 0;
    b: while(i <= nums.length - 1) {
        for (let index = i; index < nums.length; index++) {
            if (nums[index + 1] + nums[i] === target) {
                found = index + 1;
                break b;
            }
        }
        i ++;
    }
    return [i, found];
};
// @lc code=end

